<script setup lang="ts">
import {ref,onMounted }from 'vue'
const words = ref('')
const inpRef = ref <HTMLInputElement | null> (null)
onMounted(() => {
  //获取DOM元素
  console.log(inpRef.value);
  inpRef.value?.focus()
})
/**
 * HTMLInputElement
 * HTMLDivElement
 * HTMLImageElement
 */


</script>
<template>
  <div class="container" id="app">
    <div class="search-container">
      <img src="https://www.itheima.com/images/logo.png" alt="">
      <div class="search-box">
        <input type="text" v-model="words" id="inp">
        <button>搜索一下</button>
      </div>
    </div>
  </div>
</template>